#!/usr/bin/env python

import sys, os

def init ( l, admin = 0 ):
	from liwe import parts

	#parts.add ( l.layman, [ "base" ] )

	l.layman.add_js ( "modules/glpres/js/glpres.js" )
	l.layman.add_css ( "modules/glpres/css/style.css" )

	l.layman.add_js_code ( "GLPres.init();" )

	if admin and int ( admin ):
		l.layman.add_js ( "modules/glpres/js/glpres.admin.js" )
		l.layman.add_js_code ( "GLPres.admin.init();" )

	return ''

def gui ( l ):
	l.layman.add_js_code ( "GLPres.create('GLP-data', 50, 30);" );

	return '<div id="GLP-grid"><div id="GLP-data"></div></div>'

def control ( l ):
	l.layman.add_js_code ( "GLPres.control_box('GLP-control');" );

	return '<div id="GLP-control"></div>'
